﻿<UserControl x:Class="EX_NFC.FrontEnd.Windows.Controls.DeviceInfoControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <UserControl.Resources>
        <!--Control Label Style-->
        <Style x:Key="TextBlockStyle1"
               TargetType="{x:Type TextBlock}">
            <Setter Property="SnapsToDevicePixels"
                    Value="true" />
            <Setter Property="Foreground"
                    Value="{StaticResource LabelTextBrush}" />
            <Setter Property="FontFamily"
                    Value="{StaticResource ContentFontFamily}" />
            <Setter Property="FontSize"
                    Value="{DynamicResource LabelFontSize}" />
            <Setter Property="TextOptions.TextHintingMode"
                    Value="Animated" />
            <Setter Property="HorizontalAlignment"
                    Value="Right" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="FontWeight"
                    Value="Bold" />
            <Setter Property="FontStyle"
                    Value="Normal" />
            <Setter Property="Margin"
                    Value="5" />
        </Style>
        <Style x:Key="TextBlockStyleDeviceInfo"
               TargetType="{x:Type TextBlock}">
            <Setter Property="SnapsToDevicePixels"
                    Value="true" />
            <Setter Property="Foreground"
                    Value="{StaticResource LabelTextBrush}" />
            <Setter Property="FontFamily"
                    Value="{StaticResource ContentFontFamily}" />
            <Setter Property="FontSize"
                    Value="{DynamicResource LabelFontSize}" />
            <Setter Property="TextOptions.TextHintingMode"
                    Value="Animated" />
            <Setter Property="HorizontalAlignment"
                    Value="Left" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="FontWeight"
                    Value="Normal" />
            <Setter Property="FontStyle"
                    Value="Italic" />
        </Style>

    </UserControl.Resources>
    <StackPanel Orientation="Vertical">
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_DeviceConnected}"
                   Visibility="{Binding IsDeviceConnected, Converter={StaticResource BoolToVisibilityConverter}}"
                   Style="{DynamicResource TextBlockStyleGreen}"
                   Margin="{DynamicResource MediumMargin}" />
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_NoDeviceConnected}"
                   Visibility="{Binding IsDeviceConnected, Converter={StaticResource OppositeBoolToVisibilityConverter}}"
                   Style="{DynamicResource TextBlockStyleRed}"
                   Margin="{DynamicResource MediumMargin}" />

        <Grid Visibility="{Binding IsDeviceConnected, Converter={StaticResource BoolToVisibilityConverter}}"
              Margin="0,0,0,15">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <!-- COLUMN 0 - 1 -->
            <TextBlock Grid.Column="0"
                       Grid.Row="0"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_DeviceName}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="1"
                       Grid.Row="0"
                       Text="{Binding DeviceInfo.DeviceName}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <TextBlock Grid.Column="0"
                       Grid.Row="1"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_Manufactureur}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="1"
                       Grid.Row="1"
                       Text="{Binding DeviceInfo.Manufacturer}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <!-- COLUMN 2 - 3 -->
            <TextBlock Grid.Column="2"
                       Grid.Row="0"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_HasLCD}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="3"
                       Grid.Row="0"
                       Text="{Binding DeviceInfo.HasLCD}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <TextBlock Grid.Column="2"
                       Grid.Row="1"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_GraphicalLCD}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="3"
                       Grid.Row="1"
                       Text="{Binding DeviceInfo.GraphicLCD}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <!-- COLUMN 4 - 5 -->
            <TextBlock Grid.Column="4"
                       Grid.Row="0"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_LCDColumns}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="5"
                       Grid.Row="0"
                       Text="{Binding DeviceInfo.NumberOfLCDColumns}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <TextBlock Grid.Column="4"
                       Grid.Row="1"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_LCDRows}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="5"
                       Grid.Row="1"
                       Text="{Binding DeviceInfo.NumberOfLCDRows}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <!-- COLUMN 6 - 7 -->
            <TextBlock Grid.Column="6"
                       Grid.Row="0"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_LCDContrast}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="7"
                       Grid.Row="0"
                       Text="{Binding DeviceInfo.LCDContrastLevels}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <TextBlock Grid.Column="6"
                       Grid.Row="1"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_NumberOfLEDs}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="7"
                       Grid.Row="1"
                       Text="{Binding DeviceInfo.NumberOfLEDs}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <!-- COLUMN  8 - 9 -->
            <TextBlock Grid.Column="8"
                       Grid.Row="0"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_HasBuzzer}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="9"
                       Grid.Row="0"
                       Text="{Binding DeviceInfo.HasBuzzer}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
            <TextBlock Grid.Column="8"
                       Grid.Row="1"
                       Text="{Binding Source={StaticResource Localizer},Path=Localize.DeviceInfo_SAMSlots}"
                       Style="{DynamicResource TextBlockStyle1}" />
            <TextBlock Grid.Column="9"
                       Grid.Row="1"
                       Text="{Binding DeviceInfo.NumberOfSAMSlots}"
                       Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        </Grid>
    </StackPanel>
</UserControl>
